home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
pctecap.arc
/
ENVIRON.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-03-15
|
1KB
|
51 lines
(*$INCLUDE:'environ.int'*)
implementation of environment;
var
CESXQQ [extern] : word;
environmentaddress : ads of word;
environment : ads of string(32767);
procedure getparameter;
var I,L,N,P,M:integer;
var copy:lstring(255);
var found:boolean;
begin
I := 1;
N := ord(name[0]);
M := upper(parameter);
found := false;
repeat
L := scaneq(32767,chr(0),environment^,I);
if (L > N) and (environment^[I+N] = '=') then
begin
copy[0] := chr(N);
movesl (ads environment^[I],
ads copy [1], wrd(N));
if (name = copy) then
begin
P := L-N-1; if (P > M) then P := M;
parameter[0] := chr(P);
movesl (ads environment^[I+N+1],
ads parameter [1 ], wrd(P));
found := true;
end;
end;
if (L > 0) then I := I+L+1;
until found or (environment^[I] = chr(0));
if not found then parameter[0] := chr(0);
end;
begin
environmentaddress.S := CESXQQ;
environmentaddress.R := #2C;
environment.S := environmentaddress^;
environment.R := 0;
end.